/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package primitive_vs_object_datatypes;

/**
 * Reversing an integer
 * @author Iskandar Sarkawi
 */
public class Example2 {

    public static void main(String[] args) {
        Example2 ex2 = new Example2();
        ex2.primitiveDataType();
        System.out.println();
        ex2.objectDataType();
    }

    public void primitiveDataType(){
        int num = 123;

        int[] digits = { 0, 0, 0 };

        int i = 0;
        while (num != 0) {
          digits[i++] = num % 10;
          num /= 10;
        }

        for (i = 0; i < digits.length; i++)
          System.out.print(digits[i]);
      }

    public void objectDataType(){

        //need to get a good example. this does not work
        /*
        Integer num = new Integer(123);

        num = num.reverse(321);
        System.out.println(num);
         * 
         */

    }
}
